<?php
//INSERT INTO `haida`.`ywc_products` (`id`, `title`, `subtitle`, `img_src`, `price`, `sales`, `comment`, `add_time`, `status`) VALUES (NULL, '水密码海泉精华化妆品套装冬季补水', '保湿水乳液少女学生护肤品', 'img/zhong1_03.png', '390', '988', '505', '1523515763886', '1');

include_once 'dbConfig.php';

for ($i = 1; $i < 51; $i++) {
    //$insertSql = 'INSERT INTO ywc_products ( title, subtitle, img_src, price, sales, comment, add_time, status) VALUES ("水密码海泉精华化妆品套装冬季补水", "保湿水乳液少女学生护肤品", "img/zhong1_03.png", "390", "988", "505", "1523515763886", "1")';
    $ik = rand(0,4);
    $price = rand(100, 2000);
    $comment = rand(300, 3000);
    $sales = $comment + rand(200, 2000);
    $imgSrc = ['img/zhong1_03.png','img/zhong2_03.png','img/zhong3_03.png','img/zhong4_03.png','img/tu_03.png'];
    $title = ['碧欧泉 美白净透修颜防晒隔离乳霜','迪奥高级珠宝','芦荟纯正品天然补水','沁泽天然淡水珍珠耳坠','水密码海泉精华化妆品套装冬季补水'];
    $subtitle = ['30ml 紫绿蓝白粉','Diorissimo系列项链','保湿祛黄祛痘淡化痘珍珠粉面膜','18K黄金女耳钉耳环饰品','保湿水乳液少女学生护肤品'];
    $add_time = 1523510000000 + rand(0, 9999999);
    $updateSql = 'UPDATE ywc_products SET title="' . $title[$ik] . '",subtitle = "'.$subtitle[$ik].'", img_src="'.$imgSrc[$ik].'",price=' . $price . ', sales=' . $sales . ', comment=' . $comment . ', add_time=' . $add_time . ' WHERE id=' . $i;

   if ($link->query($updateSql)) {
       echo 'sucdasdascess!!<br/>';
   }
}



